package cn.eclass.bean;

import cn.eclass.bean.api.IStudyCardBean;
import cn.eclass.dao.StudyCardDao;
import cn.eclass.entity.StudyCardEntity;
import java.util.List;

public class StudyCardBean implements IStudyCardBean {

    private StudyCardDao dao = new StudyCardDao();

    @Override
    public StudyCardEntity add(StudyCardEntity entity) {
        int newId = dao.add(entity);
        entity.setId(newId);
        return entity;
    }

    @Override
    public boolean update(StudyCardEntity entity) {
        return dao.update(entity);
    }

    @Override
    public boolean delete(int id) {
        return dao.delete(id);
    }

    @Override
    public StudyCardEntity get(int id) {
        return dao.get(id);
    }

    @Override
    public List<StudyCardEntity> list() {
        return dao.list();
    }
}
